package com.project.bean;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * 用户实体类
 */
public class UserBean {
//    用户id
    private Integer id;
//    用户名
@Pattern(regexp = "[a-zA-Z\\u4e00-\\u9fa5]{2,}",message = "姓名必须为两个以上的汉字或字母")
    private String userName;
//    密码
    @Pattern(regexp = "[0-9]{1,}",message = "密码必须是1位字符以上的字符组成")
    private String password;
//    用户邮箱
      @Email (message = "邮箱格式必须为aa@qq.com")
    private String userMail;
//    用户头像
    private String userImg;
    public UserBean(){

    }

    public UserBean(String userName, String password, String userMail, String userImg) {
        this.userName = userName;
        this.password = password;
        this.userMail = userMail;
        this.userImg = userImg;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUserMail() {
        return userMail;
    }

    public void setUserMail(String userMail) {
        this.userMail = userMail;
    }

    public String getUserImg() {
        return userImg;
    }

    public void setUserImg(String userImg) {
        this.userImg = userImg;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", userMail='" + userMail + '\'' +
                ", userImg='" + userImg + '\'' +
                "}\n";
    }
}

